﻿namespace Gpt4All;

/// <summary>
/// Interface for text prediction services
/// </summary>
public interface ITextPrediction
{
    /// <summary>
    /// Get prediction results for the prompt and provided options.
    /// </summary>
    /// <param name="text">The text to complete</param>
    /// <param name="opts">The prediction settings</param>
    /// <param name="cancellation">The <see cref="CancellationToken"/> for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
    /// <returns>The prediction result generated by the model</returns>
    Task<ITextPredictionResult> GetPredictionAsync(
        string text,
        PredictRequestOptions opts,
        CancellationToken cancellation = default);

    /// <summary>
    /// Get streaming prediction results for the prompt and provided options.
    /// </summary>
    /// <param name="text">The text to complete</param>
    /// <param name="opts">The prediction settings</param>
    /// <param name="cancellationToken">The <see cref="CancellationToken"/> for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
    /// <returns>The prediction result generated by the model</returns>
    Task<ITextPredictionStreamingResult> GetStreamingPredictionAsync(
        string text,
        PredictRequestOptions opts,
        CancellationToken cancellationToken = default);
}
